﻿using MediatR;
using T_Material.Domain;
using T_Material.Infrastructure.Interface;
using T_Material.Read.API.Application.Commands.RequisitionCommand;
using T_Material.Read.API.Application.Commands.StatisticsCommand;

namespace T_Material.Read.API.Application.CommandHandlers.StatisticsHandler
{
    public class StatisticsInfoCommandHandler : IRequestHandler<StatisticsInfoCommand, Statistics>
    {
        private readonly IStatisticsRepository statisticsRepository;
        public StatisticsInfoCommandHandler(IStatisticsRepository statisticsRepository)
        {
            this.statisticsRepository = statisticsRepository;
        }
        public async Task<Statistics> Handle(StatisticsInfoCommand request, CancellationToken cancellationToken)
        {
           var info=await statisticsRepository.Get(request.Id);
            return info;
        }
    }
}
